<?php

class Admin extends MY_Controller
{
	function Admin()
	{
		parent::MY_Controller();
	}
	
	public function index()
	{
		if( ! $this->session->userdata('admin') )
		{
			show_404();
			die;
		}
		
		$this->load->model('Admin_model', 'admin');
		
		$viewdata['user_count'] = $this->admin->getUserCount();
		$viewdata['task_count'] = $this->admin->getTaskCount();
		$viewdata['tag_count'] = $this->admin->getTagCount();
		$viewdata['task_tag_count'] = $this->admin->getTaskTagCount();
		$viewdata['sess_count'] = $this->admin->getSessionCount();
		$viewdata['bug_count'] = $this->admin->getBugReportsCount();
		
		$this->data['content'] = $this->load->view('admin/basic', $viewdata, true);
		$this->load->view('global/master-view', $this->data);
	}
}